<template>
	<view class="">
		<my-issue @submit="add" />
	</view>
</template>

<script>
	import myIssue from '@/components/myIssue.vue'
	export default {
		components: {
			myIssue
		},
		data() {
			return {
				id: "",
				info: {}
			}
		},
		onLoad(option) {
			var that = this;
			that.id = option.id;
			that.$axios('Op/preComment', "POST", 'order', {
				orderid: that.id
			}).then(res => {
				if (res.data.code == 200) {
					that.info = res.data.data
				}
			}, (error) => {

			})
		},
		methods: {
			add: function(e) {
				var that = this;
				that.$axios('Op/comment', "POST", 'order', {
					orderid: that.id,
					level: e.score,
					content: e.textareaValue,
					images: e.imgs
				}).then(res => {
					if (res.data.code == 200) {
						this.$api.msg('评价成功！');
						setTimeout(()=>{
							this.$navBack();
						},1000)
					}
				}, (error) => {

				})
			}
		}
	}
</script>

<style lang="scss">

</style>
